<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/yuwanzi.io/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/yuwanzi.io/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/yuwanzi.io/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/yuwanzi.io/images/logo.svg" color="#222">

<link rel="stylesheet" href="/yuwanzi.io/css/main.css">



<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/css/all.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css">

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"suyuhuan.gitee.io","root":"/yuwanzi.io/","images":"/yuwanzi.io/images","scheme":"Muse","version":"8.2.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Suche...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"}};
  </script>
<meta name="description" content="概述 由于二叉查找树的性能与树的高度(即根节点到底部节点的深度)相关,因此当高度较大时,二叉查找树的性能就会下降.为了更高效的性能,平衡查找树应运而生,它能保证无论键的插入顺序如何,树的高度都将是总键数的对数. 2-3查找树就是平衡树的一种. 性质 2-3查找树允许树中的一个节点保存多个键.**我们可以将二叉查找树中的节点称为2-节点,而在2-3查找树中引入了3-节点,它含有两个键和三条链接.**">
<meta property="og:type" content="article">
<meta property="og:title" content="《Algorithms,4th Edition》读书笔记-2-3查找树">
<meta property="og:url" content="https://suyuhuan.gitee.io/yuwanzi.io/2017/03/28/2017-3-28-2_3tree/index.html">
<meta property="og:site_name" content="玉丸子 | Blog">
<meta property="og:description" content="概述 由于二叉查找树的性能与树的高度(即根节点到底部节点的深度)相关,因此当高度较大时,二叉查找树的性能就会下降.为了更高效的性能,平衡查找树应运而生,它能保证无论键的插入顺序如何,树的高度都将是总键数的对数. 2-3查找树就是平衡树的一种. 性质 2-3查找树允许树中的一个节点保存多个键.**我们可以将二叉查找树中的节点称为2-节点,而在2-3查找树中引入了3-节点,它含有两个键和三条链接.**">
<meta property="og:locale">
<meta property="og:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-anatomy.png">
<meta property="og:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-search.png">
<meta property="og:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-insert2.png">
<meta property="og:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-insert3a.png">
<meta property="og:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-insert3b.png">
<meta property="og:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-insert3c.png">
<meta property="og:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-split.png">
<meta property="og:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-random.png">
<meta property="article:published_time" content="2017-03-28T10:00:00.000Z">
<meta property="article:modified_time" content="2020-11-07T00:58:17.000Z">
<meta property="article:author" content="玉丸子">
<meta property="article:tag" content="2017">
<meta property="article:tag" content="Algorithms">
<meta property="article:tag" content="Tree">
<meta property="article:tag" content="数据结构">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://algs4.cs.princeton.edu/33balanced/images/23tree-anatomy.png">


<link rel="canonical" href="https://suyuhuan.gitee.io/yuwanzi.io/2017/03/28/2017-3-28-2_3tree/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh'
  };
</script>
<title>《Algorithms,4th Edition》读书笔记-2-3查找树 | 玉丸子 | Blog</title>
  




  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

<link rel="alternate" href="/yuwanzi.io/atom.xml" title="玉丸子 | Blog" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Navigationsleiste an/ausschalten" role="button">
    </div>
  </div>

  <div class="site-meta">

    <a href="/yuwanzi.io/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">玉丸子 | Blog</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>







</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Inhaltsverzeichnis
        </li>
        <li class="sidebar-nav-overview">
          Übersicht
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%A6%82%E8%BF%B0"><span class="nav-number">1.</span> <span class="nav-text">概述</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%80%A7%E8%B4%A8"><span class="nav-number">2.</span> <span class="nav-text">性质</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9F%A5%E6%89%BE"><span class="nav-number">3.</span> <span class="nav-text">查找</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%8F%92%E5%85%A5"><span class="nav-number">4.</span> <span class="nav-text">插入</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%90%912-%E8%8A%82%E7%82%B9%E4%B8%AD%E6%8F%92%E5%85%A5%E6%96%B0%E9%94%AE"><span class="nav-number">4.1.</span> <span class="nav-text">向2-节点中插入新键</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%90%91%E4%B8%80%E6%A3%B5%E5%8F%AA%E5%90%AB%E6%9C%89%E4%B8%80%E4%B8%AA3-%E8%8A%82%E7%82%B9%E7%9A%84%E6%A0%91%E4%B8%AD%E6%8F%92%E5%85%A5%E6%96%B0%E9%94%AE"><span class="nav-number">4.2.</span> <span class="nav-text">向一棵只含有一个3-节点的树中插入新键</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%90%91%E4%B8%80%E4%B8%AA%E7%88%B6%E8%8A%82%E7%82%B9%E4%B8%BA2-%E8%8A%82%E7%82%B9%E7%9A%843-%E8%8A%82%E7%82%B9%E4%B8%AD%E6%8F%92%E5%85%A5%E6%96%B0%E9%94%AE"><span class="nav-number">4.3.</span> <span class="nav-text">向一个父节点为2-节点的3-节点中插入新键</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%90%91%E4%B8%80%E4%B8%AA%E7%88%B6%E8%8A%82%E7%82%B9%E4%B8%BA3-%E8%8A%82%E7%82%B9%E7%9A%843-%E8%8A%82%E7%82%B9%E4%B8%AD%E6%8F%92%E5%85%A5%E6%96%B0%E9%94%AE"><span class="nav-number">4.4.</span> <span class="nav-text">向一个父节点为3-节点的3-节点中插入新键</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%88%86%E8%A7%A3%E6%A0%B9%E8%8A%82%E7%82%B9"><span class="nav-number">4.5.</span> <span class="nav-text">分解根节点</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%85%B7%E4%BD%93%E5%AE%9E%E7%8E%B0"><span class="nav-number">5.</span> <span class="nav-text">具体实现</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%80%BB%E7%BB%93"><span class="nav-number">6.</span> <span class="nav-text">总结</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#end"><span class="nav-number">7.</span> <span class="nav-text">end</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">玉丸子</p>
  <div class="site-description" itemprop="description">这里是玉丸子的个人博客,与你一起发现更大的世界。</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/yuwanzi.io/archives">
          <span class="site-state-item-count">68</span>
          <span class="site-state-item-name">Artikel</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/yuwanzi.io/categories/">
        <span class="site-state-item-count">39</span>
        <span class="site-state-item-name">Kategorien</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/yuwanzi.io/tags/">
        <span class="site-state-item-count">46</span>
        <span class="site-state-item-name">schlagwörter</span></a>
      </div>
  </nav>
</div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh">
    <link itemprop="mainEntityOfPage" href="https://suyuhuan.gitee.io/yuwanzi.io/2017/03/28/2017-3-28-2_3tree/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/yuwanzi.io/images/avatar.gif">
      <meta itemprop="name" content="玉丸子">
      <meta itemprop="description" content="这里是玉丸子的个人博客,与你一起发现更大的世界。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="玉丸子 | Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          《Algorithms,4th Edition》读书笔记-2-3查找树
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Veröffentlicht am</span>

      <time title="Erstellt: 2017-03-28 18:00:00" itemprop="dateCreated datePublished" datetime="2017-03-28T18:00:00+08:00">2017-03-28</time>
    </span>
      <span class="post-meta-item">
        <span class="post-meta-item-icon">
          <i class="far fa-calendar-check"></i>
        </span>
        <span class="post-meta-item-text">Bearbeitet am</span>
        <time title="Geändert am: 2020-11-07 08:58:17" itemprop="dateModified" datetime="2020-11-07T08:58:17+08:00">2020-11-07</time>
      </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">in</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/yuwanzi.io/categories/Algorithms/" itemprop="url" rel="index"><span itemprop="name">Algorithms</span></a>
        </span>
          . 
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/yuwanzi.io/categories/Algorithms/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" itemprop="url" rel="index"><span itemprop="name">数据结构</span></a>
        </span>
          . 
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/yuwanzi.io/categories/Algorithms/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/Tree/" itemprop="url" rel="index"><span itemprop="name">Tree</span></a>
        </span>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h3 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h3><hr>
<p>由于<code>二叉查找树</code>的性能与树的高度(即根节点到底部节点的深度)相关,因此当高度较大时,<code>二叉查找树</code>的性能就会下降.为了更高效的性能,<code>平衡查找树</code>应运而生,它能保证<strong>无论键的插入顺序如何,树的高度都将是总键数的对数.</strong></p>
<p><code>2-3查找树</code>就是平衡树的一种.</p>
<h3 id="性质"><a href="#性质" class="headerlink" title="性质"></a>性质</h3><hr>
<p><code>2-3查找树</code><strong>允许树中的一个节点保存多个键.**我们可以将<code>二叉查找树</code>中的节点称为<code>2-节点</code>,而在<code>2-3查找树</code>中引入了<code>3-节点</code>,它</strong>含有两个键和三条链接.**</p>
<p><img src="http://algs4.cs.princeton.edu/33balanced/images/23tree-anatomy.png" alt="2-3查找树"></p>
<blockquote>
<p>一棵<code>2-3查找树</code>由以下节点组成: </p>
<ul>
<li><p><code>2-节点</code> : 含有一个键(及其对应的值)和两条链接,左链接指向的<code>2-3查找树</code>中的键都小于该节点,右链接指向的<code>2-3查找树</code>中的键都大于该节点.</p>
</li>
<li><p><code>3-节点</code> : 含有两个键(及其对应的值)和三条链接,左链接指向的<code>2-3查找树</code>中的键都小于该节点,<strong>中链接指向的<code>2-3查找树</code>中的键都位于该节点的两个键之间</strong>,右链接指向的<code>2-3查找树</code>中的键都大于该节点.</p>
</li>
</ul>
</blockquote>
<p>一棵完美平衡的<code>2-3查找树</code>中的<strong>所有空链接到根节点的距离都应该是相同的.</strong></p>
<h3 id="查找"><a href="#查找" class="headerlink" title="查找"></a>查找</h3><hr>
<p><code>2-3查找树</code>的查找算法与<code>二叉查找树</code>基本相似.</p>
<ul>
<li>首先,要判断一个键需要先将它和根节点中的键进行比较.</li>
</ul>
<ul>
<li>如果它和其中任意一个相等,查找命中.</li>
</ul>
<ul>
<li>否则,根据比较的结果找到指向相应区间的链接,并在其指向的子树中递归地继续查找.</li>
</ul>
<ul>
<li>如果最后指向空链接,查找未命中.</li>
</ul>
<p><img src="http://algs4.cs.princeton.edu/33balanced/images/23tree-search.png" alt="2-3树查找操作的路径轨迹"></p>
<h3 id="插入"><a href="#插入" class="headerlink" title="插入"></a>插入</h3><hr>
<p>由于<code>2-3查找树</code>需要保持完美平衡性,所以它的插入算法并不像<code>二叉查找树</code>那么简单.</p>
<p>它的插入算法基本思想是 : <strong>一直向上不断分解临时的<code>4-节点</code>并将中键插入更高层的父节点中,直至遇到一个<code>2-节点</code>并将它替换为一个不需要继续分解的<code>3-节点</code>,或是到达<code>3-节点</code>的根(分解根节点)</strong></p>
<h4 id="向2-节点中插入新键"><a href="#向2-节点中插入新键" class="headerlink" title="向2-节点中插入新键"></a>向2-节点中插入新键</h4><p>如果未命中的查找结束于一个<code>2-节点</code>,只需要把这个<code>2-</code>节点替换为一个<code>3-节点</code>,将要插入的键保存在其中即可.</p>
<p><img src="http://algs4.cs.princeton.edu/33balanced/images/23tree-insert2.png"></p>
<h4 id="向一棵只含有一个3-节点的树中插入新键"><a href="#向一棵只含有一个3-节点的树中插入新键" class="headerlink" title="向一棵只含有一个3-节点的树中插入新键"></a>向一棵只含有一个3-节点的树中插入新键</h4><p>如果我们需要向一棵只含有一个<code>3-节点</code>的树中插入一个新键(这棵树中唯一的节点已经没有可插入新键的空间了).</p>
<ol>
<li>先临时将新键存入该节点中,使之成为一个<code>4-节点</code>(它扩展了以前的节点并含有3个键和4条链接).</li>
</ol>
<ol start="2">
<li>将<code>4-节点</code>分解为一棵由3个<code>2-</code>节点组成的<code>2-3查找树</code>,其中一个节点(根)含有中键,一个节点含有3个键中的最小者(和根节点的左链接相连),一个节点含有3个键中的最大者(和根节点的右链接相连).</li>
</ol>
<ol start="3">
<li>这时,这棵树既是一棵含有3个节点的<code>二叉查找树</code>,同时也是一棵完美平衡的<code>2-3查找树</code>.</li>
</ol>
<p><img src="http://algs4.cs.princeton.edu/33balanced/images/23tree-insert3a.png"></p>
<h4 id="向一个父节点为2-节点的3-节点中插入新键"><a href="#向一个父节点为2-节点的3-节点中插入新键" class="headerlink" title="向一个父节点为2-节点的3-节点中插入新键"></a>向一个父节点为2-节点的3-节点中插入新键</h4><p>如果未命中的查找结束于一个<code>3-节点</code>,而它的父节点是一个<code>2-节点</code>.这种情况下,我们需要在<strong>维持树的完美平衡性的前提下为新键腾出空间.</strong></p>
<ol>
<li>构造一个临时的<code>4-节点</code>并将其分解(此时并不会为中键创建一个新节点).</li>
</ol>
<ol start="2">
<li>将中键移动至父节点中(可以看做将指向<code>3-节点</code>的一条链接替换为新父节点中的原中键左右两边的两条链接,并分别指向两个新的<code>2-节点</code>).</li>
</ol>
<p><img src="http://algs4.cs.princeton.edu/33balanced/images/23tree-insert3b.png"></p>
<h4 id="向一个父节点为3-节点的3-节点中插入新键"><a href="#向一个父节点为3-节点的3-节点中插入新键" class="headerlink" title="向一个父节点为3-节点的3-节点中插入新键"></a>向一个父节点为3-节点的3-节点中插入新键</h4><p>如果未命中的查找结束于一个父节点为<code>3-节点</code>且它本身也是一个<code>3-节点</code>时.我们可以构造一个临时的<code>4-节点</code>并分解它.将中键插入到它的父节点中.</p>
<p>但由于它的父节点也是一个<code>3-节点</code>,所以需要再用这个中键构造一个新的临时<code>4-节点</code>,然后在这个节点上进行相同的变换,即分解这个父节点并将它的中键插入到它的父节点中.</p>
<p>重复相同的变换直到遇到一个<code>2-节点</code>(将<code>2-节点</code>替换为一个<code>3-节点</code>)或者到达根节点(分解根节点).</p>
<p><img src="http://algs4.cs.princeton.edu/33balanced/images/23tree-insert3c.png"></p>
<h4 id="分解根节点"><a href="#分解根节点" class="headerlink" title="分解根节点"></a>分解根节点</h4><p>如果从<strong>插入节点到根节点的路径上全部都是<code>3-节点</code></strong>.那么根节点最终会变成一个临时的<code>4-节点</code>,这时可以将<code>4-节点</code>分解为3个<code>2-节点</code>,同时树高加1(仍然保持了树的完美平衡性,因为它变换的是根节点).</p>
<p><img src="http://algs4.cs.princeton.edu/33balanced/images/23tree-split.png"></p>
<h3 id="具体实现"><a href="#具体实现" class="headerlink" title="具体实现"></a>具体实现</h3><hr>
<p>关于如何使用一个简单的数据结构来表达实现<code>2-3查找树</code>可以见此文  <a target="_blank" rel="noopener" href="http://sylvanassun.github.io/2017/03/29/red_black_binary_search_tree/">&lt;&lt;Algorithms,4th Edition&gt;&gt;读书笔记-红黑二叉查找树</a> </p>
<h3 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h3><hr>
<p><code>2-3查找树</code>的根本在于<strong>插入操作中的变换操作都是局部的</strong>,除了相关的节点和链接之外不必修改或者检查树的其他部分.</p>
<p>每次变换都会将<code>4-节点</code>中的一个键移动至它的父节点中,并重构相应的链接而不必涉及树的其他部分.且保持了树的完美平衡性,例如在变换之前根节点到所有空链接的路径长度为<code>h</code>,那么变换之后该长度仍然为<code>h</code>.<strong>只有进行根节点分解时,所有空链接到根节点的路径长度才会加1.</strong></p>
<p><img src="http://algs4.cs.princeton.edu/33balanced/images/23tree-random.png"></p>
<p>通过这些我们可以总结得出: <strong><code>2-3查找树</code>的生长是由下向上的.</strong> (标准的<code>二叉查找树</code>则是由上向下生长的)</p>
<h3 id="end"><a href="#end" class="headerlink" title="end"></a>end</h3><hr>
<ul>
<li><p>Author : <a target="_blank" rel="noopener" href="https://github.com/SylvanasSun">SylvanasSun</a></p>
</li>
<li><p>Email : <a href="mailto:&#x73;&#x79;&#x6c;&#x76;&#x61;&#x6e;&#97;&#115;&#x73;&#117;&#x6e;&#x5f;&#x78;&#116;&#x7a;&#x40;&#49;&#54;&#x33;&#x2e;&#99;&#111;&#109;">&#x73;&#x79;&#x6c;&#x76;&#x61;&#x6e;&#97;&#115;&#x73;&#117;&#x6e;&#x5f;&#x78;&#116;&#x7a;&#x40;&#49;&#54;&#x33;&#x2e;&#99;&#111;&#109;</a></p>
</li>
<li><p>本文参考资料引用自<a target="_blank" rel="noopener" href="http://algs4.cs.princeton.edu/33balanced/">&lt;&lt;Algorithms,4th Edition&gt;&gt;</a></p>
</li>
</ul>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/yuwanzi.io/tags/2017/" rel="tag"># 2017</a>
              <a href="/yuwanzi.io/tags/Algorithms/" rel="tag"># Algorithms</a>
              <a href="/yuwanzi.io/tags/Tree/" rel="tag"># Tree</a>
              <a href="/yuwanzi.io/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/" rel="tag"># 数据结构</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/yuwanzi.io/2017/03/26/2017-3-26-binary_search_tree/" rel="prev" title="     《Algorithms,4th Edition》读书笔记-二叉查找树">
                  <i class="fa fa-chevron-left"></i>      《Algorithms,4th Edition》读书笔记-二叉查找树
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/yuwanzi.io/2017/03/30/2017-3-30-red_black_binary_search_tree/" rel="next" title="《Algorithms,4th Edition》读书笔记-红黑二叉查找树">
                  《Algorithms,4th Edition》读书笔记-红黑二叉查找树 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>







<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      const activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      const commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">玉丸子</span>
</div>
  <div class="powered-by">Erstellt mit  <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/muse/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a>
  </div>

    </div>
  </footer>

  
  <script src="//cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js"></script>
<script src="/yuwanzi.io/js/utils.js"></script><script src="/yuwanzi.io/js/motion.js"></script><script src="/yuwanzi.io/js/schemes/muse.js"></script><script src="/yuwanzi.io/js/next-boot.js"></script>

  






  





</body>
</html>
